package com.kaifamiao.collection;

import java.util.Arrays;

public class ContainerTest {

	public static void main(String[] args) {
		
		Container c = new Container(3);
		System.out.println( c.isEmpty() + " , " + c.size() );
		
		System.out.println( c );
		
		c.add( "唐长老" );
		c.add( "孙悟空" );
		c.add( "白龙马" );
		c.add( null );
		
		System.out.println( c );
		
		System.out.println( c.isEmpty() + " , " + c.size() );
		
		c.add( "猪刚鬣" );
		
		System.out.println( c );
		
		Object[] array = c.toArray();
		System.out.println( Arrays.toString( array ));
		array[ 3 ] = "猪悟能" ;
		System.out.println( Arrays.toString( array ));
		
		System.out.println( c );
		
		System.out.println( c.contains( null ) );
		System.out.println( c.contains( "孙悟空" ) );
		System.out.println( c.contains( "null" ) );
		
		c.remove( null );
		System.out.println( c );
		
		c.remove( "唐长老" );
		System.out.println( c );
		
		c.remove( "猪刚鬣" );
		System.out.println( c );
		
		c.remove( "白龙马" );
		System.out.println( c );
		
		c.remove( "孙悟空" );
		System.out.println( c );
		
		c.clear();
		
		System.out.println( c );
		
		System.out.println( c.isEmpty() + " , " + c.size() );
		
		
		Container n = new Container(1);
		n.add( "诸葛亮" );
		n.remove( "诸葛亮" ); 
		
	}

}
